package com.example.ws.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@TableName("chat_history")
@ApiModel("聊天记录信息")
public class ChatHistory {
    //消息id
    @ApiModelProperty("消息id")
    private Integer id;
    //消息内容
    @ApiModelProperty("消息内容")
    private String content;
    //消息发起人
    @ApiModelProperty("消息发起人")
    private String fromUser;
    //消息接收人
    @ApiModelProperty("消息接收人")
    private String toUser;
    //发送消息时间
    @ApiModelProperty("发送消息时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:MM:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:MM:ss")
    private LocalDateTime createdAt;

}
